<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserBank extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //  `user_id` int(11) NOT NULL COMMENT '用户ID',
        //  `type` tinyint(1) NOT NULL COMMENT '账户类型，1：银行，2：支付宝，3：微信',
        //  `account` varchar(255) NOT NULL COMMENT '银行卡类型为用户证实姓名，支付宝或微信是支付宝或微信的账号',
        //  `card` varchar(255) NOT NULL COMMENT '银行卡号',
        //  `bank_id` int(11) NOT NULL COMMENT '银行ID',
        Schema::dropIfExists('user_bank');
        Schema::create('user_bank', function (Blueprint $table){
            $table->comment = "用户银行信息";
            $table->increments('id')->comment("ID");

            $table->integer('user_id')->comment("用户ID");
            $table->tinyInteger("type")->comment("账户类型");
            $table->string("account")->comment("相关账户");
            $table->string("card")->comment("银行卡号");
            $table->integer("bank_id")->comment("银行");

            //$table->integer('create_time')->comment("创建时间");
            //$table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
